USE [CTEM-DB-v1]
GO

/****** Object:  StoredProcedure [dbo].[WorkerSalary_Create]    Script Date: 02/10/2012 11:15:37 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



-- =============================================
-- Author:		TienDH
-- Create date: 12/05/2011
-- Description:	Get full employee's information
-- =============================================
CREATE PROCEDURE [dbo].[WorkerSalary_Create]
	@constructionID			bigint,
	@name					NVARCHAR(225),
	@fromDate				DateTime,
	@toDate					DateTime,
	@Task					NVARCHAR(MAX),
	@totalSalary			decimal(18, 0),
	@createdBy				nvarchar(50),
	@OthersCost				bigint,
	@TotalCost				bigint,
	@Manager				nvarchar(50),
	@Reason					nvarchar(MAX)

AS
	DECLARE @createDate	DATETIME
    SET     @createDate = GETDATE()
BEGIN
	INSERT INTO WorkersSalary 
			(ConstructionID,Name,FromDate,ToDate, Task,Reason,
			TotalSalary,CreateDate,CreatedBy,OthersCost,TotalCost,Manager)
	VALUES	(@constructionID,@name,@fromDate,@toDate, @Task,@Reason,
			@totalSalary,@createDate,@createdBy,@OthersCost,@TotalCost,@Manager)	
	SELECT  IDENT_CURRENT('WorkersSalary')
END

GO

